import type { OrderApi, RefundApi } from '.'
import http from '@/utils/http'

export interface PayRecordResp extends OrderApi.Order {

}

export interface RefundRecordResp extends RefundApi.Refund {

}

export interface PayRecordSummaryResp {
  totalCount: number
  actualTotalPrice: number
}

export interface RefundRecordSummaryResp {
  totalCount: number
  totalRefundPrice: number
}

/** 收款明细 */
export function getPayRecordPage(query: any) {
  return http.get<Page<PayRecordResp[]>>(`/shop/pay/record/page`, query)
}

export function exportPayRecord(query: any) {
  return http.download(`/shop/pay/record/export`, query)
}

export function getPayRecordSummary(query: any): any {
  return http.get<PayRecordSummaryResp>(`/shop/pay/record/summary`, query)
}

/** 退款明细 */
export function getRefundRecordPage(query: any) {
  return http.get<Page<RefundRecordResp[]>>(`/shop/refund/record/page`, query)
}

export function exportRefundRecord(query: any) {
  return http.download(`/shop/refund/record/export`, query)
}

export function getRefundRecordSummary(query: any): any {
  return http.get<RefundRecordSummaryResp>(`/shop/refund/record/summary`, query)
}
